package com.ssy.wireless.web.service;

import com.ssy.wireless.entity.MessageAuth;
import com.ssy.wireless.entity.MessageAuthStat;
import com.ssy.wireless.mapper.MessageAuthMapper;
import com.ssy.wireless.mapper.MessageAuthStatMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * Created by cofey on 16/11/20.
 */
@Service
@Transactional(readOnly = true)
public class MessageAuthService {
    @Autowired
    private MessageAuthMapper messageAuthMapper;
    @Autowired
    private MessageAuthStatMapper messageAuthStatMapper;

    public List<MessageAuth> find(Map<String, Object> params) {
        return messageAuthMapper.select(params);
    }

    public List<MessageAuthStat> findStatistics(Map<String, Object> params) {
        return messageAuthStatMapper.selectStatistics(params);
    }

    /**
     * 获取上月短信认证情况
     *
     * @return
     */
    public MessageAuthStat selectLastMonthStat() {
        return messageAuthStatMapper.selectLastMonthStat();
    }

    /**
     * 获取上年短信认证情况
     *
     * @return
     */
    public MessageAuthStat selectLastYearhStat() {
        return messageAuthStatMapper.selectLastYearhStat();
    }
}
